package extraction;

import preprocessor.*;
import desambiguation.*;

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;


public class Main {
	
    public static void main(String[] args)
    {
        ConnectorDB bd;
        Connection mySource;
        ResultSet rs;
        int i = 0;
        
        bd = new ConnectorDB();
        
        mySource = bd.getConnection();
      
        if(mySource!=null)
        {
        	/* Recuperamos los comentarios de la base de datos*/
            try {
				rs = mySource.createStatement().executeQuery("SELECT post FROM posts");
				while (rs.next()){
					System.out.println("post Nº " + i + ": " + rs.getString("post"));
					i = i + 1;
				}
			} catch (SQLException ex) {
				System.out.println("Error en la consulta "+ ex.getMessage());
				rs=null;
			}
            
            
            bd.closeConnection();
        }
    }

}
